I know this issue is around for some time. I guess since the introduction of Java design element. I've seen at least a couple of posts on this forum, Notes 8.5 forum as well as on stackoverflow, but I wonder if anybody has found a workaround.
The problom occurs when you edit some unrelated design element; Java class suddenly stops loading with a message similar to one below:
Error while executing JavaScript action expression
Script interpreter error, line=5, col=48: Error while
calling java constructor 'com.xxx.xpages.DriveInfo(number)'
(java.lang.reflect.InvocationTargetException).
com.xxx.xpages.DriveInfo$Drive
Here it finds the the parent class and tries to execute constructor, but does not find the internal one. But it can be any class - internal or not. It might be an error like this:
Script interpreter error, line=5, col=48: [ReferenceError] 'com' not found
Here it does not find the main class. Not even the package that contains several other classes.
This problem appears both in client and on server, that is - the design really becomes corrupt and replication sends the corruption to server. The problem is not really the corruption of design element itself - the source code is fine - it's just the compiled class that seems to have vanished.
This does not happen every time, but often enough to be real bother, since any unrelated change forces you to re-test all xpages in all test scenarios that might try loading some classes.
I cannot find any other option as to "touch" the particular java design element using Designer in order to fix the issue. And then while trying to touch one class the other might break...
"clean" or "build" do not help. On stackoverflow thread (http://stackoverflow.com/questions/13512961/xpages-java-corruption-issue) the "accepted" answer is about Extension library, but in my case I do not use extension library. The thing is just broken.
I've seen suggestions that the "old style" method of storing Java code in file system does not have this effect, but the "new" way somehow feels easier and it's a natural expectation that something this basic must work. And it would be really great if the classes could be shown in hierarchy instead of just a flat view (I know that I can access it from package explorer as well, but having at least an hierarchical option for the "Application" view could be even better.
Any ideas about a "quick fix", "permanent fix" or a workaround?